

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Blog - React</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta property="og:title" content="Blog - React">
  <meta property="og:type" content="website">
  <meta property="og:url" content="https://facebook.github.io/react/blog/page22/">
  <meta property="og:image" content="https://facebook.github.io/react/img/logo_og.png">
  <meta property="og:description" content="A JavaScript library for building user interfaces">
  <meta property="fb:app_id" content="623268441017527">

  <link rel="shortcut icon" href="/favicon.ico">
  <link rel="alternate" type="application/rss+xml" title="React" href="https://facebook.github.io/react/feed.xml">

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" />
  <link rel="stylesheet" href="/css/syntax.css">
  <link rel="stylesheet" href="/css/codemirror.css">
  <link rel="stylesheet" href="/css/react.css">

  <script src="//use.typekit.net/vqa1hcx.js"></script>
  <script>try{Typekit.load();}catch(e){}</script>

  <!--[if lte IE 8]>
  <script src="/js/html5shiv.min.js"></script>
  <script src="/js/es5-shim.min.js"></script>
  <script src="/js/es5-sham.min.js"></script>
  <![endif]-->
  <script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
  <script src="/js/codemirror.js"></script>
  <script src="/js/javascript.js"></script>
  <script src="/js/xml.js"></script>
  <script src="/js/jsx.js"></script>
  <script src="/js/react.js"></script>
  <script src="/js/react-dom.js"></script>
  <script src="/js/babel.min.js"></script>
  <script src="/js/live_editor.js"></script>
</head>
<body>

  <div class="container">

    <div class="nav-main">
  <div class="wrap">
    <a class="nav-home" href="/">
      <img class="nav-logo" src="/img/logo.svg" width="36" height="36">
      React
    </a>
    <div class="nav-lists">
      <ul class="nav-site nav-site-internal">
        <li><a href="/docs/hello-world.html">Docs</a></li>
        <li><a href="/tutorial/tutorial.html">Tutorial</a></li>
        <li><a href="/community/support.html">Community</a></li>
        <li><a href="/blog/" class="active">Blog</a></li>
        <li class="nav-site-search">
          <input id="algolia-doc-search" type="text" placeholder="Search docs..." />
        </li>
      </ul>
      <ul class="nav-site nav-site-external">
        <li><a href="https://github.com/facebook/react">GitHub</a></li>
        <li><a href="https://github.com/facebook/react/releases">v16.0.0-alpha.3</a></li>
      </ul>
    </div>
  </div>
</div>


    <section class="content wrap blogContent">
  <div class="nav-docs nav-blog">
  <div class="nav-docs-section">
    <h3>Recent posts</h3>
    <ul>
      
        <li><a href="/blog/2016/11/16/react-v15.4.0.html">React v15.4.0</a></li>
      
        <li><a href="/blog/2016/09/28/our-first-50000-stars.html">Our First 50,000 Stars</a></li>
      
        <li><a href="/blog/2016/08/05/relay-state-of-the-state.html">Relay: State of the State</a></li>
      
        <li><a href="/blog/2016/07/22/create-apps-with-no-configuration.html">Create Apps with No Configuration</a></li>
      
        <li><a href="/blog/2016/07/13/mixins-considered-harmful.html">Mixins Considered Harmful</a></li>
      
        <li><a href="/blog/2016/07/11/introducing-reacts-error-code-system.html">Introducing React's Error Code System</a></li>
      
        <li><a href="/blog/2016/04/08/react-v15.0.1.html">React v15.0.1</a></li>
      
        <li><a href="/blog/2016/04/07/react-v15.html">React v15.0</a></li>
      
        <li><a href="/blog/2016/03/29/react-v0.14.8.html">React v0.14.8</a></li>
      
        <li><a href="/blog/2016/03/16/react-v15-rc2.html">React v15.0 Release Candidate 2</a></li>
      
      <li><a href="/blog/all.html">All posts ...</a></li>
    </ul>
  </div>
</div>

  <div class="inner-content">
    
      <div class="post-list-item">
        

<h1>

  <a href="/blog/2013/06/19/community-roundup-2.html">Community Round-up #2</a>

</h1>

<p class="meta">
  June 19, 2013
  by
  
    
      <a href="https://twitter.com/vjeux">Vjeux</a>
    
    
  
</p>

<hr>

<div class="post">
  <p>Since the launch we have received a lot of feedback and are actively working on React 0.4. In the meantime, here are the highlights of this week.</p>

<h2>Some quick thoughts on React</h2>

<p><a href="http://www.andrewgreig.com/">Andrew Greig</a> made a blog post that gives a high level description of what React is.</p>

<blockquote>
<p>I have been using Facebooks recently released Javascript framework called React.js for the last few days and have managed to obtain a rather high level understanding of how it works and formed a good perspective on how it fits in to the entire javascript framework ecosystem.</p>

<p>Basically, React is not an MVC framework. It is not a replacement for Backbone or Knockout or Angular, instead it is designed to work with existing frameworks and help extend their functionality.</p>

<p>It is designed for building big UIs. The type where you have lots of reusable components that are handling events and presenting and changing some backend data. In a traditional MVC app, React fulfils the role of the View. So you would still need to handle the Model and Controller on your own.</p>

<p>I found the best way to utilise React was to pair it with Backbone, with React replacing the Backbone View, or to write your own Model/Data object and have React communicate with that.</p>

<p><a href="http://www.andrewgreig.com/637/">Read the full post...</a></p>
</blockquote>

<h2>React and Socket.IO Chat Application</h2>

<p><a href="https://danialk.github.io/">Danial Khosravi</a> made a real-time chat application that interacts with the back-end using Socket.IO.</p>

<blockquote>
<p>A week ago I was playing with AngularJS and <a href="https://github.com/btford/angular-socket-io-im">this little chat application</a> which uses socket.io and nodejs for realtime communication. Yesterday I saw a post about ReactJS in <a href="http://www.echojs.com/">EchoJS</a> and started playing with this UI library. After playing a bit with React, I decided to write and chat application using React and I used Bran Ford&#39;s Backend for server side of this little app.
<figure><a href="https://danialk.github.io/blog/2013/06/16/reactjs-and-socket-dot-io-chat-application/"><img src="/img/blog/chatapp.png" alt=""></a></figure></p>

<p><a href="https://danialk.github.io/blog/2013/06/16/reactjs-and-socket-dot-io-chat-application/">Read the full post...</a></p>
</blockquote>

<h2>React and Other Frameworks</h2>

<p><a href="http://www.petehunt.net/blog/">Pete Hunt</a> wrote an answer on Quora comparing React and Angular directives. At the end, he explains how you can make an Angular directive that is in fact being rendered with React.</p>

<blockquote>
<p>To set the record straight: React components are far more powerful than Angular templates; they should be compared with Angular&#39;s directives instead. So I took the first Google hit for &quot;AngularJS directive tutorial&quot; (AngularJS Directives Tutorial - Fundoo Solutions), rewrote it in React and compared them. [...]</p>

<p>We&#39;ve designed React from the beginning to work well with other libraries. Angular is no exception. Let&#39;s take the original Angular example and use React to implement the fundoo-rating directive.</p>

<p><a href="https://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-AngularJS-A-Closer-Look">Read the full post...</a></p>
</blockquote>

<p>In the same vein, <a href="https://twitter.com/markov_twain/status/345702941845499906">Markov Twain</a> re-implemented the examples on the front-page <a href="http://jsbin.com/azihiw/2/edit">with Ember</a> and <a href="https://twitter.com/vla">Vlad Yazhbin</a> re-implemented the tutorial <a href="http://jsfiddle.net/vla/Cdrse/">with Angular</a>.</p>

<h2>Web Components: React &amp; x-tags</h2>

<p>Mozilla and Google are actively working on Web Components. <a href="http://blog.vjeux.com/">Vjeux</a> wrote a proof of concept that shows how to implement them using React.</p>

<blockquote>
<p>Using <a href="http://www.x-tags.org/">x-tags</a> from Mozilla, we can write custom tags within the DOM. This is a great opportunity to be able to write reusable components without being tied to a particular library. I wrote <a href="https://github.com/vjeux/react-xtags/">x-react</a> to have them being rendered in React.
<figure><a href="http://blog.vjeux.com/2013/javascript/custom-components-react-x-tags.html"><img src="/img/blog/xreact.png" alt=""></a></figure></p>

<p><a href="http://blog.vjeux.com/2013/javascript/custom-components-react-x-tags.html">Read the full post...</a></p>
</blockquote>

<h2>React TodoMVC Example</h2>

<p><a href="http://todomvc.com/">TodoMVC.com</a> is a website that collects various implementations of the same basic Todo app. <a href="http://www.petehunt.net/blog/">Pete Hunt</a> wrote an idiomatic React version.</p>

<blockquote>
<p>Developers these days are spoiled with choice when it comes to selecting an MV* framework for structuring and organizing their JavaScript web apps.</p>

<p>To help solve this problem, we created TodoMVC - a project which offers the same Todo application implemented using MV* concepts in most of the popular JavaScript MV* frameworks of today.
<figure><a href="http://todomvc.com/labs/architecture-examples/react/"><img src="/img/blog/todomvc.png" alt=""></a></figure></p>

<p><a href="https://github.com/tastejs/todomvc/tree/gh-pages/labs/architecture-examples/react">Read the source code...</a></p>
</blockquote>

<h2>JSX is not HTML</h2>

<p>Many of you pointed out differences between JSX and HTML. In order to clear up some confusion, we have added some documentation that covers the four main differences:</p>

<ul>
<li><a href="/docs/jsx-is-not-html.html">Whitespace removal</a></li>
<li><a href="/docs/jsx-is-not-html.html">HTML Entities</a></li>
<li><a href="/docs/jsx-is-not-html.html">Comments</a></li>
<li><a href="/docs/jsx-is-not-html.html">Custom HTML Attributes</a></li>
</ul>

</div>



      </div>
    
      <div class="post-list-item">
        

<h1>

  <a href="/blog/2013/06/12/community-roundup.html">Community Round-up #1</a>

</h1>

<p class="meta">
  June 12, 2013
  by
  
    
      <a href="https://twitter.com/vjeux">Vjeux</a>
    
    
  
</p>

<hr>

<div class="post">
  <p>React was open sourced two weeks ago and it&#39;s time for a little round-up of what has been going on.</p>

<h2>Khan Academy Question Editor</h2>

<p>It looks like <a href="http://benalpert.com/">Ben Alpert</a> is the first person outside of Facebook and Instagram to push React code to production. We are very grateful for his contributions in form of pull requests, bug reports and presence on IRC (<a href="irc://chat.freenode.net/reactjs">#reactjs on Freenode</a>). Ben wrote about his experience using React:</p>

<blockquote>
<p>I just rewrote a 2000-line project in React and have now made a handful of pull requests to React. Everything about React I&#39;ve seen so far seems really well thought-out and I&#39;m proud to be the first non-FB/IG production user of React.</p>

<p>The project that I rewrote in React (and am continuing to improve) is the Khan Academy question editor which content creators can use to enter questions and hints that will be presented to students:
<figure><a href="http://benalpert.com/2013/06/09/using-react-to-speed-up-khan-academy.html"><img src="/img/blog/khan-academy-editor.png" alt=""></a></figure></p>

<p><a href="http://benalpert.com/2013/06/09/using-react-to-speed-up-khan-academy.html">Read the full post...</a></p>
</blockquote>

<h2>Pimp my Backbone.View (by replacing it with React)</h2>

<p><a href="https://blog.mayflower.de/">Paul Seiffert</a> wrote a blog post that explains how to integrate React into Backbone applications.</p>

<blockquote>
<p>React has some interesting concepts for JavaScript view objects that can be used to eliminate this one big problem I have with Backbone.js.</p>

<p>As in most MVC implementations (although React is probably just a VC implementation), a view is one portion of the screen that is managed by a controlling object. This object is responsible for deciding when to re-render the view and how to react to user input. With React, these view-controllers objects are called components. A component knows how to render its view and how to handle to the user&#39;s interaction with it.</p>

<p>The interesting thing is that React is figuring out by itself when to re-render a view and how to do this in the most efficient way.</p>

<p><a href="https://blog.mayflower.de/3937-Backbone-React.html">Read the full post...</a></p>
</blockquote>

<h2>Using facebook&#39;s React with require.js</h2>

<p><a href="http://blog.xenji.com/">Mario Mueller</a> wrote a menu component in React and was able to easily integrate it with require.js, EventEmitter2 and bower.</p>

<blockquote>
<p>I recently stumbled upon facebook&#39;s React library, which is a Javascript library for building reusable frontend components. Even if this lib is only at version 0.3.x it behaves very stable, it is fast and is fun to code. I&#39;m a big fan of require.js, so I tried to use React within the require.js eco system. It was not as hard as expected and here are some examples and some thoughts about it.</p>

<p><a href="http://blog.xenji.com/2013/06/facebooks-react-require-js.html">Read the full post...</a></p>
</blockquote>

<h2>Origins of React</h2>

<p><a href="http://www.petehunt.net/blog/">Pete Hunt</a> explained what differentiates React from other JavaScript libraries in <a href="/blog/2013/06/05/why-react.html">a previous blog post</a>. <a href="http://leebyron.com/">Lee Byron</a> gives another perspective on Quora:</p>

<blockquote>
<p>React isn&#39;t quite like any other popular Javascript libraries, and it solves a very specific problem: complex UI rendering. It&#39;s also intended to be used along side many other popular libraries. For example, React works well with Backbone.js, amongst many others.</p>

<p>React was born out of frustrations with the common pattern of writing two-way data bindings in complex MVC apps. React is an implementation of one-way data bindings.</p>

<p><a href="https://www.quora.com/React-JS-Library/How-is-Facebooks-React-JavaScript-library/answer/Lee-Byron?srid=3DcX">Read the full post...</a></p>
</blockquote>

</div>



      </div>
    
      <div class="post-list-item">
        

<h1>

  <a href="/blog/2013/06/05/why-react.html">Why did we build React?</a>

</h1>

<p class="meta">
  June  5, 2013
  by
  
    
      <a href="https://twitter.com/floydophone">Pete Hunt</a>
    
    
  
</p>

<hr>

<div class="post">
  <p>There are a lot of JavaScript MVC frameworks out there. Why did we build React
and why would you want to use it?</p>

<h2>React isn&#39;t an MVC framework.</h2>

<p>React is a library for building composable user interfaces. It encourages
the creation of reusable UI components which present data that changes over
time.</p>

<h2>React doesn&#39;t use templates.</h2>

<p>Traditionally, web application UIs are built using templates or HTML directives.
These templates dictate the full set of abstractions that you are allowed to use
to build your UI.</p>

<p>React approaches building user interfaces differently by breaking them into
<strong>components</strong>. This means React uses a real, full featured programming language
to render views, which we see as an advantage over templates for a few reasons:</p>

<ul>
<li><strong>JavaScript is a flexible, powerful programming language</strong> with the ability
to build abstractions. This is incredibly important in large applications.</li>
<li>By unifying your markup with its corresponding view logic, React can actually
make views <strong>easier to extend and maintain</strong>.</li>
<li>By baking an understanding of markup and content into JavaScript, there&#39;s
<strong>no manual string concatenation</strong> and therefore less surface area for XSS
vulnerabilities.</li>
</ul>

<p>We&#39;ve also created <a href="/docs/jsx-in-depth.html">JSX</a>, an optional syntax
extension, in case you prefer the readability of HTML to raw JavaScript.</p>

<h2>Reactive updates are dead simple.</h2>

<p>React really shines when your data changes over time.</p>

<p>In a traditional JavaScript application, you need to look at what data changed
and imperatively make changes to the DOM to keep it up-to-date. Even AngularJS,
which provides a declarative interface via directives and data binding <a href="https://code.angularjs.org/1.0.8/docs/guide/directive#reasonsbehindthecompilelinkseparation">requires
a linking function to manually update DOM nodes</a>.</p>

<p>React takes a different approach.</p>

<p>When your component is first initialized, the <code>render</code> method is called,
generating a lightweight representation of your view. From that representation,
a string of markup is produced, and injected into the document. When your data
changes, the <code>render</code> method is called again. In order to perform updates as
efficiently as possible, we diff the return value from the previous call to
<code>render</code> with the new one, and generate a minimal set of changes to be applied
to the DOM.</p>

<blockquote>
<p>The data returned from <code>render</code> is neither a string nor a DOM node -- it&#39;s a
lightweight description of what the DOM should look like.</p>
</blockquote>

<p>We call this process <strong>reconciliation</strong>. Check out
<a href="http://jsfiddle.net/2h6th4ju/">this jsFiddle</a> to see an example of
reconciliation in action.</p>

<p>Because this re-render is so fast (around 1ms for TodoMVC), the developer
doesn&#39;t need to explicitly specify data bindings. We&#39;ve found this approach
makes it easier to build apps.</p>

<h2>HTML is just the beginning.</h2>

<p>Because React has its own lightweight representation of the document, we can do
some pretty cool things with it:</p>

<ul>
<li>Facebook has dynamic charts that render to <code>&lt;canvas&gt;</code> instead of HTML.</li>
<li>Instagram is a &quot;single page&quot; web app built entirely with React and
<code>Backbone.Router</code>. Designers regularly contribute React code with JSX.</li>
<li>We&#39;ve built internal prototypes that run React apps in a web worker and use
React to drive <strong>native iOS views</strong> via an Objective-C bridge.</li>
<li>You can run React
<a href="https://github.com/petehunt/react-server-rendering-example">on the server</a>
for SEO, performance, code sharing and overall flexibility.</li>
<li>Events behave in a consistent, standards-compliant way in all browsers
(including IE8) and automatically use
<a href="http://davidwalsh.name/event-delegate">event delegation</a>.</li>
</ul>

<p>Head on over to <a href="/react">facebook.github.io/react</a> to check out what we have
built. Our documentation is geared towards building apps with the framework,
but if you are interested in the nuts and bolts
<a href="/support.html">get in touch</a> with us!</p>

<p>Thanks for reading!</p>

</div>



      </div>
    
      <div class="post-list-item">
        

<h1>

  <a href="/blog/2013/06/02/jsfiddle-integration.html">JSFiddle Integration</a>

</h1>

<p class="meta">
  June  2, 2013
  by
  
    
      <a href="https://twitter.com/vjeux">Vjeux</a>
    
    
  
</p>

<hr>

<div class="post">
  <p><a href="https://jsfiddle.net">JSFiddle</a> just announced support for React. This is an exciting news as it makes collaboration on snippets of code a lot easier. You can play around this <strong><a href="http://jsfiddle.net/vjeux/kb3gN/">base React JSFiddle</a></strong>, fork it and share it! A <a href="http://jsfiddle.net/vjeux/VkebS/">fiddle without JSX</a> is also available.</p>

<blockquote class="twitter-tweet" align="center"><p>React (by Facebook) is now available on JSFiddle. <a href="http://t.co/wNQf9JPv5u" title="http://facebook.github.io/react/">facebook.github.io/react/</a></p>&mdash; JSFiddle (@jsfiddle) <a href="https://twitter.com/jsfiddle/status/341114115781177344">June 2, 2013</a></blockquote>

<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

</div>



      </div>
    

    <div class="pagination">
      
        <a href="/blog/page21/" class="previous">
          &laquo; Previous Page
        </a>
      
      
    </div>
  </div>
</section>


    <footer class="nav-footer">
  <section class="sitemap">
    <a href="/" class="nav-home">
    </a>
    <div>
      <h5><a href="/docs/">Docs</a></h5>
      <a href="/docs/hello-world.html">Quick Start</a>
      <a href="/docs/thinking-in-react.html">Thinking in React</a>
      <a href="/tutorial/tutorial.html">Tutorial</a>
      <a href="/docs/jsx-in-depth.html">Advanced Guides</a>
    </div>
    <div>
      <h5><a href="/community/support.html">Community</a></h5>
      <a href="http://stackoverflow.com/questions/tagged/reactjs" target="_blank">Stack Overflow</a>
      <a href="https://discuss.reactjs.org/" target="_blank">Discussion Forum</a>
      <a href="https://discord.gg/0ZcbPKXt5bZjGY5n" target="_blank">Reactiflux Chat</a>
      <a href="https://www.facebook.com/react" target="_blank">Facebook</a>
      <a href="https://twitter.com/reactjs" target="_blank">Twitter</a>
    </div>
    <div>
      <h5><a href="/community/support.html">Resources</a></h5>
      <a href="/community/conferences.html">Conferences</a>
      <a href="/community/videos.html">Videos</a>
      <a href="https://github.com/facebook/react/wiki/Examples" target="_blank">Examples</a>
      <a href="https://github.com/facebook/react/wiki/Complementary-Tools" target="_blank">Complementary Tools</a>
    </div>
    <div>
      <h5>More</h5>
      <a href="/blog/">Blog</a>
      <a href="https://github.com/facebook/react" target="_blank">GitHub</a>
      <a href="http://facebook.github.io/react-native/" target="_blank">React Native</a>
      <a href="/acknowledgements.html">Acknowledgements</a>
    </div>
  </section>
  <a href="https://code.facebook.com/projects/" target="_blank" class="fbOpenSource">
    <img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/>
  </a>
  <section class="copyright">
    Copyright © 2017 Facebook Inc.
  </section>
</footer>

  </div>

  <div id="fb-root"></div>
  <script src="/js/anchor-links.js"></script>
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    ga('create', 'UA-41298772-1', 'facebook.github.io');
    ga('send', 'pageview');

    !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");

    (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6&appId=623268441017527";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));

    docsearch({
      apiKey: '36221914cce388c46d0420343e0bb32e',
      indexName: 'react',
      inputSelector: '#algolia-doc-search'
    });
  </script>
</body>
</html>
